package com.i360day.redis.configuration;

import com.i360day.redis.aspect.RedisCacheAspect;
import com.i360day.redis.configuration.manager.RedisCacheManageTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;

@Configuration
public class RedisCacheConfiguration {

    /**
     * <p> @Author liju.z <p>
     *
     * <p> @Description 缓存切面 <p>
     *
     * <p> @Date  16:43 <p>
     **/
    @Bean
    public RedisCacheAspect redisAspect() {
        return new RedisCacheAspect();
    }


    @Bean("redisCacheManagerTemplate")
    public RedisCacheManageTemplate redisCacheManagerTemplate(RedisConnectionFactory redisConnectionFactory) {
        return new RedisCacheManageTemplate(redisConnectionFactory);
    }
}
